<table class="table table-hover">
    <tr>
        <th>ID</th>
        <th>名称</th>
        <th>操作</th>
    </tr>
    <?php foreach($data as $v):?>
    <tr>
        <td><?php echo $v['id']?></td>
        <td><?php echo $v['name']?></td>
        <td>
            <a href="javascript:;" data-id="<?php echo $v['id']?>" class="btn btn-primary btn-xs update">修改</a>

            <a href="javascript:;" data-msg="确定删除吗?" data-id="delete" data-src="<?php echo U('Admin/AfterSales/ProblemType/delete')?>" data-data={"id":<?php echo $v['id']?>} class="btn btn-danger btn-xs _ajaxNote">删除</a>
        </td>
    </tr>
    <?php endforeach;?>
</table>
<script>

    $(function(){

        $('.update').unbind('click');
        $('.update').click(function(){

            var data = {};
            data.id = $(this).data('id');
            data.action = 'template';

            showMessage('','','<?php echo U("Admin/AfterSales/ProblemType/update")?>',{'data':data},0);



        })

    });

    function ajaxRequestCallback(result,id,_this){

        if (result.code == 200) {

            layer.msg(result.msg,{shift:1,offset:50});

            _this
                    .parent()
                    .parent()
                    .fadeOut(200,function(){

                        $(this).remove();

                    })

        } else {

            showMessage(result.msg,result.code,'','',2000);

        }

    }

</script>
